#include "widget.h"
#include "ui_widget.h"
#include"QPushButton"
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton *button =new QPushButton(this);
    button->setText("点击关闭窗口");
    button->resize(800,600);
    //connect(button,SIGNAL(clicked()),this,SLOT(close()));
    connect(button,&QPushButton::clicked,this,&QWidget::close);
}

Widget::~Widget()
{
    delete ui;
}

